<template>
  <div class="tab bor-b-e9e9e9">
    <ul v-for="(item,index) in tabs" :key="index" :class="[tabIndex == index?'sec':'']" @click="getTabsIndex(index)">{{item}}</ul>
  </div>
</template>

<script>

export default {
  props: ["tabs"],
  // props:['tabs'],
  data() {
    return {
      tabIndex: 0
    };
  },
  methods: {
    //像父级传递值
    getTabsIndex(index) {
      this.tabIndex = index;
      this.$emit("F_GetTabsIndex", index);
    }
  }
};
</script>

<!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped>
.tab {
  width: 100vw;
  height: 100px;
  display: flex;
  justify-content: space-around;
  align-items: center;
  background: #ffffff;
  font-size: 32px;
}
.tab ul {
  height: 96px;
  line-height: 96px;
}
.sec {
  border-bottom: 4px solid #e93636;
  color: #e93636;
  font-weight: 700;
}
</style>
